﻿Imports DTO
Public Class HoaDonDAO
    Public Shared Function Them(ByVal hd As HoaDon) As Integer
        Dim sql As String = "insert into HOADON(TenKhachHang,DiaChiKhachHang,NgayThanhToan,TriGia) values('" + hd.TenKhachHang + "','" + hd.DiaChiKhachHang + "','" + hd.NgayThanhToan + "'," + hd.TriGia.ToString() + ")"
        Return Dataprovider.ExecuteNonQuery(sql)
    End Function
    Public Shared Function LayMaxMa() As Integer
        Dim sql As String = "select MAX(MaHoaDon) from HOADON"
        Return Integer.Parse(Dataprovider.ExecuteScalar(sql))
    End Function
End Class
